3.1.34 \(\int \frac {d+\frac {e}{x}}{c+\frac {a}{x^2}} \, dx\) [34]

Optimal. Leaf size=49 \[ \frac {d x}{c}-\frac {\sqrt {a} d \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{c^{3/2}}+\frac {e \log \left (a+c x^2\right )}{2 c} \]

[Out]

d*x/c+1/2*e*ln(c*x^2+a)/c-d*arctan(x*c^(1/2)/a^(1/2))*a^(1/2)/c^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {1408, 788, 649, 211, 266} \begin {gather*} -\frac {\sqrt {a} d \text {ArcTan}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{c^{3/2}}+\frac {e \log \left (a+c x^2\right )}{2 c}+\frac {d x}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e/x)/(c + a/x^2),x]

[Out]

(d*x)/c - (Sqrt[a]*d*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/c^(3/2) + (e*Log[a + c*x^2])/(2*c)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 788

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Simp[e*g*(x/c), x] + Dist[1
/c, Int[(c*d*f - a*e*g + c*(e*f + d*g)*x)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x]

Rule 1408

Int[((a_) + (c_.)*(x_)^(n2_.))^(p_.)*((d_) + (e_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(n*(2*p + q))*(e + d/x
^n)^q*(c + a/x^(2*n))^p, x] /; FreeQ[{a, c, d, e, n}, x] && EqQ[n2, 2*n] && IntegersQ[p, q] && NegQ[n]

Rubi steps

\begin {align*} \int \frac {d+\frac {e}{x}}{c+\frac {a}{x^2}} \, dx &=\int \frac {x (e+d x)}{a+c x^2} \, dx\\ &=\frac {d x}{c}+\frac {\int \frac {-a d+c e x}{a+c x^2} \, dx}{c}\\ &=\frac {d x}{c}-\frac {(a d) \int \frac {1}{a+c x^2} \, dx}{c}+e \int \frac {x}{a+c x^2} \, dx\\ &=\frac {d x}{c}-\frac {\sqrt {a} d \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{c^{3/2}}+\frac {e \log \left (a+c x^2\right )}{2 c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 49, normalized size = 1.00 \begin {gather*} \frac {d x}{c}-\frac {\sqrt {a} d \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{c^{3/2}}+\frac {e \log \left (a+c x^2\right )}{2 c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e/x)/(c + a/x^2),x]

[Out]

(d*x)/c - (Sqrt[a]*d*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/c^(3/2) + (e*Log[a + c*x^2])/(2*c)

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 42, normalized size = 0.86

method result size
default \(\frac {d x}{c}+\frac {\frac {e \ln \left (c \,x^{2}+a \right )}{2}-\frac {a d \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}}{c}\) \(42\)
risch \(\frac {d x}{c}+\frac {\ln \left (-\sqrt {-a c}\, x -a \right ) d \sqrt {-a c}}{2 c^{2}}+\frac {\ln \left (-\sqrt {-a c}\, x -a \right ) e}{2 c}-\frac {\ln \left (\sqrt {-a c}\, x -a \right ) d \sqrt {-a c}}{2 c^{2}}+\frac {\ln \left (\sqrt {-a c}\, x -a \right ) e}{2 c}\) \(98\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e/x)/(c+a/x^2),x,method=_RETURNVERBOSE)

[Out]

d*x/c+1/c*(1/2*e*ln(c*x^2+a)-a*d/(a*c)^(1/2)*arctan(c*x/(a*c)^(1/2)))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 43, normalized size = 0.88 \begin {gather*} -\frac {a d \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {d x}{c} + \frac {e \log \left (c x^{2} + a\right )}{2 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2),x, algorithm="maxima")

[Out]

-a*d*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + d*x/c + 1/2*e*log(c*x^2 + a)/c

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 110, normalized size = 2.24 \begin {gather*} \left [\frac {d \sqrt {-\frac {a}{c}} \log \left (\frac {c x^{2} - 2 \, c x \sqrt {-\frac {a}{c}} - a}{c x^{2} + a}\right ) + 2 \, d x + e \log \left (c x^{2} + a\right )}{2 \, c}, -\frac {2 \, d \sqrt {\frac {a}{c}} \arctan \left (\frac {c x \sqrt {\frac {a}{c}}}{a}\right ) - 2 \, d x - e \log \left (c x^{2} + a\right )}{2 \, c}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2),x, algorithm="fricas")

[Out]

[1/2*(d*sqrt(-a/c)*log((c*x^2 - 2*c*x*sqrt(-a/c) - a)/(c*x^2 + a)) + 2*d*x + e*log(c*x^2 + a))/c, -1/2*(2*d*sq
rt(a/c)*arctan(c*x*sqrt(a/c)/a) - 2*d*x - e*log(c*x^2 + a))/c]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (42) = 84\).
time = 0.13, size = 112, normalized size = 2.29 \begin {gather*} \left (\frac {e}{2 c} - \frac {d \sqrt {- a c^{3}}}{2 c^{3}}\right ) \log {\left (x + \frac {- 2 c \left (\frac {e}{2 c} - \frac {d \sqrt {- a c^{3}}}{2 c^{3}}\right ) + e}{d} \right )} + \left (\frac {e}{2 c} + \frac {d \sqrt {- a c^{3}}}{2 c^{3}}\right ) \log {\left (x + \frac {- 2 c \left (\frac {e}{2 c} + \frac {d \sqrt {- a c^{3}}}{2 c^{3}}\right ) + e}{d} \right )} + \frac {d x}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x**2),x)

[Out]

(e/(2*c) - d*sqrt(-a*c**3)/(2*c**3))*log(x + (-2*c*(e/(2*c) - d*sqrt(-a*c**3)/(2*c**3)) + e)/d) + (e/(2*c) + d
*sqrt(-a*c**3)/(2*c**3))*log(x + (-2*c*(e/(2*c) + d*sqrt(-a*c**3)/(2*c**3)) + e)/d) + d*x/c

________________________________________________________________________________________

Giac [A]
time = 4.53, size = 43, normalized size = 0.88 \begin {gather*} -\frac {a d \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {d x}{c} + \frac {e \log \left (c x^{2} + a\right )}{2 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2),x, algorithm="giac")

[Out]

-a*d*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + d*x/c + 1/2*e*log(c*x^2 + a)/c

________________________________________________________________________________________

Mupad [B]
time = 1.59, size = 39, normalized size = 0.80 \begin {gather*} \frac {e\,\ln \left (c\,x^2+a\right )}{2\,c}+\frac {d\,x}{c}-\frac {\sqrt {a}\,d\,\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )}{c^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e/x)/(c + a/x^2),x)

[Out]

(e*log(a + c*x^2))/(2*c) + (d*x)/c - (a^(1/2)*d*atan((c^(1/2)*x)/a^(1/2)))/c^(3/2)

________________________________________________________________________________________